﻿using System.Linq;
using WebApplication1.Services;

namespace WebApplication1.Presenters.Client
{
    public class ListPresenter
    {
        private DetailsPresenter[] _items;

        public DetailsPresenter[] Items
        {
            get {
                if (_items == null)
                {
                    _items = ClientService
                        .GetAll()
                        .Select(item => new DetailsPresenter(item))
                        .ToArray();
                }
                return _items;
            }
        }
    }
}